package com.yangke.springcloud.service.impl;

import com.yangke.springcloud.service.PaymentHystrixService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 此方法继承了接口之后，进行统一的全局处理，优先级是最高的
 * 优先级：
 *      @FeignClients注解中的fallback = PaymentFallbackServiceImpl.class属性 > @DefaultProperties(defaultFallback = "payment_global_fallback") > 在方法中声明的fallback方法
 * @author wyk
 * @create 2022--10--17:56
 */
@Component
@Slf4j
public class PaymentFallbackServiceImpl implements PaymentHystrixService {
    @Override
    public String paymentIofo_OK(Integer id) {
        log.info("--------paymentIofo_OK__fallback--------");
        return "对方服务器发生故障或本服务器发生异常，请稍后再试......";

    }

    @Override
    public String paymentIofo_TIMEOUT(Integer id) {
        log.info("--------paymentIofo_TIMEOUT__fallback--------");
        return "对方服务器发生故障或本服务器发生异常，请稍后再试......";
    }
}
